<template>
  <div id="mian" class="register-page">
    <Theader title="喵喵电影"></Theader>
    <div class="login_body">
      <div>
        <input
          class="login_text"
          type="text"
          placeHolder="账户名/手机号/Email"
          v-model="username"
        />
      </div>
      <div>
        <input
          class="login_text"
          type="password"
          placeHolder="请输入您的密码"
          v-model="password"
        />
      </div>
      <div class="login_btn">
        <input
          type="submit"
          value="注册"
          @click="register(username, password)"
        />
      </div>
      <div class="login_link">
        <a href="#" @click="login">已有账号？立即登录</a>
        <a href="#">找回密码</a>
      </div>
    </div>
    <Tfooter></Tfooter>
  </div>
</template>

<script>
import Theader from "@/components/Theader";
import Tfooter from "@/components/Tfooter";
export default {
  name: "Login",
  components: {
    Tfooter,
    Theader,
  },
  data() {
    return {
      username: "",
      password: "",
    };
  },
  methods: {
    login() {
      this.$router.push("/mine/login");
    },
    register(username, password) {
      window.localStorage.setItem("username", username);
      window.localStorage.setItem("password", password);
      this.$router.push("/mine/login");
    },
  },
};
</script>

<style scoped>
#content .login_body {
  width: 100%;
}
.register-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  background: white;
  animation: slide 0.5s;
}
@keyframes slide {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
.login_body .login_text {
  width: 100%;
  height: 40px;
  border: none;
  border-bottom: 1px #ccc solid;
  margin-bottom: 5px;
  outline: none;
  text-indent: 10px;
}
.login_body .login_btn {
  height: 50px;
  margin: 10px;
}
.login_body .login_btn input {
  width: 100%;
  height: 100%;
  background: #e54847;
  border-radius: 3px;
  border: none;
  display: block;
  color: white;
  font-size: 20px;
}
.login_body .login_link {
  display: flex;
  justify-content: space-between;
}
.login_body .login_link a {
  text-decoration: none;
  margin: 0 5px;
  font-size: 12px;
  color: #e54847;
}
</style>